﻿
@{
    
    var fullname = Session["_UserNameFull"] == null ? "" : Session["_UserNameFull"].ToString();
    }

<img class="top_logo" src="../../Content/Image/admin/logo_top.png" onclick="onpenLink('m1', '/')" />
 <div class="div_login">
        <ul class="us_loginTop">
            
            @{if (!string.IsNullOrEmpty(fullname))
              {
                <li>
                    <div id="nameUser">@("Hello " + fullname)</div>    
                </li>
                <li>
                    <a href="/CusLand/NewCusLand?id=">Đăng tin</a>   
                </li>
                <li>
                    <a href="#" onclick="logOut()">Đăng xuất</a>
                </li>
              }
              else
              {
                <li>
                    <a href="#" onclick="openRegister()">Đăng ký</a>
                </li>
                <li>
                    <a href="#" onclick="openLogin()">Đăng nhâp</a>
                </li>
              }
            }
        </ul>
    </div>
<div id="menu" class="top_menu">
   
    <ul class="menu">
       @* <li class="m1"><a onclick="onpenLink('m1', '/Home')">Trang Chủ</a></li>
        <li class="m2"><a onclick="onpenLink('m2', '/KimThanh_info/About_us')">Giới Thiệu</a></li>
        <li class="m3"><a href="#" onclick="openProject('thao-dien-pearl')">Dự án</a>
            <ul class="subnav">
                @*<li class="m3-1"><a href="/du-an/thao-dien-pearl" onclick="openProject('thao-dien-pearl')">Thảo Điền Pearl</a></li>
                <li class="m3-2"><a href="/du-an/sai-gon-airport-plaza" onclick="openProject('sai-gon-airport-plaza')">Sài Gòn Airport Plaza</a></li>
                <li class="m3-3"><a href="/du-an/sai-gon-pearl" onclick="openProject('sai-gon-pearl')">Sài Gòn Pearl</a></li>
                <li class="m3-4"><a href="/du-an/ssggroup-tower" onclick="openProject('ssggroup-tower')">SSGGROUP Tower</a></li>* @
                <li class="m3-1"><a href="/du-an/thao-dien-pearl" onclick="openProject()">Thảo Điền Pearl</a></li>
                <li class="m3-2"><a href="/du-an/sai-gon-airport-plaza" onclick="openProject()">Sài Gòn Airport Plaza</a></li>
                <li class="m3-3"><a href="/du-an/sai-gon-pearl" onclick="openProject()">Sài Gòn Pearl</a></li>
                <li class="m3-4"><a href="/du-an/ssggroup-tower" onclick="openProject()">SSGG Tower</a></li>
                <li class="m3-5"><a href="/du-an/masteri-thao-dien" onclick="openProject()">Masteri Thảo Điền</a></li>
            </ul>
        
        </li>
        <li class="m4"><a onclick="onpenLink('m4', '/KimThanh_info/news')">Tin Tức</a></li>
        <li class="m5"><a onclick="onpenLink('m5', '/proland/Getland')">Sàn Giao Dịch</a></li>
        <li class="m6"><a onclick="onpenLink('m6', '/KimThanh_info/Contact')">Liên Hệ</a></li>*@
    </ul>
</div>

<div id="copyright" style="display: none;"><a href="http://apycom.com/"></a></div> @*phan tu sinh cua menu*@

<script type="text/javascript">
   

    function setSelectMenu(menuId, url) {
        var dt = new Date();
        var href = "/home/SetSessionSelect?menuId=" + menuId + "&dt=" + dt.getTime();
        $.ajax({ type: 'POST', url: href, data: null, success: function (response) {
            window.location.assign(url);
        }
        });
    }

    function onpenLink(curentmenu, url) {
        setSelectMenu(curentmenu);
        
        setTimeout(function () {            
            window.location = "/";
        }, 500);
    }


    function openProject() {
        setSelectMenu('m3');
    }

    function openLogin() {
        var urlLogin = "/user/UserLogin";
        $("#popup_content").load(urlLogin);
          
    }

    function logOut() {
        $.post("/user/LogoutAction", null, function (data) {          
                window.location = "/Home";            
        });
    }

    function openRegister() {
        var _registerUrl = "/user/RegisterUser";
        $("#popup_content").load(_registerUrl);
       
    }


    $(document).ready(function () {
        var href = "/menu/GetMenuView";
        $("#menu").load(href);
 //       var sessionMenu = '';
//        setTimeout(function () {   
//          //  $("#menu ul.menu li").removeClass("current");           
//            var crMenu = $("#menu ul.menu").find("li." + sessionMenu);
//            crMenu.addClass("current");
//            //setCurr(crMenu);

//        }, 1000);

    });

</script>


   @*menu*@
@* <script src="../../Scripts/menu.js" type="text/javascript"></script> *@